using NHibernate.Criterion;
using Rhino.Commons;
using WineCellar.Business.Entities;
using WineCellar.Business.ServiceInterfaces;

namespace WineCellar.Business.Services
{
    public class UserService :IUserService
    {
        public User GetUser(string userName)
        {
            var criteria = DetachedCriteria.For(typeof(User));
            criteria.Add(new SimpleExpression("UserName", userName, "=", true));
            return Repository<User>.FindFirst(criteria);
        }
    }
}